\(\int \csc ^2(c+d x) (a-a \csc (c+d x)) (A+A \csc (c+d x)) \, dx\) [8]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 30, antiderivative size = 17 \[ \int \csc ^2(c+d x) (a-a \csc (c+d x)) (A+A \csc (c+d x)) \, dx=\frac {a A \cot ^3(c+d x)}{3 d} \]

[Out]

1/3*a*A*cot(d*x+c)^3/d

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {4047, 2687, 30} \[ \int \csc ^2(c+d x) (a-a \csc (c+d x)) (A+A \csc (c+d x)) \, dx=\frac {a A \cot ^3(c+d x)}{3 d} \]

[In]

Int[Csc[c + d*x]^2*(a - a*Csc[c + d*x])*(A + A*Csc[c + d*x]),x]

[Out]

(a*A*Cot[c + d*x]^3)/(3*d)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2687

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rule 4047

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)
]*(d_.) + (c_))^(n_.), x_Symbol] :> Dist[((-a)*c)^m, Int[ExpandTrig[(g*csc[e + f*x])^p*cot[e + f*x]^(2*m), (c
+ d*csc[e + f*x])^(n - m), x], x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2
 - b^2, 0] && IntegersQ[m, n] && GeQ[n - m, 0] && GtQ[m*n, 0]

Rubi steps \begin{align*} \text {integral}& = -\left ((a A) \int \cot ^2(c+d x) \csc ^2(c+d x) \, dx\right ) \\ & = -\frac {(a A) \text {Subst}\left (\int x^2 \, dx,x,-\cot (c+d x)\right )}{d} \\ & = \frac {a A \cot ^3(c+d x)}{3 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.00 \[ \int \csc ^2(c+d x) (a-a \csc (c+d x)) (A+A \csc (c+d x)) \, dx=\frac {a A \cot ^3(c+d x)}{3 d} \]

[In]

Integrate[Csc[c + d*x]^2*(a - a*Csc[c + d*x])*(A + A*Csc[c + d*x]),x]

[Out]

(a*A*Cot[c + d*x]^3)/(3*d)

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.93 (sec) , antiderivative size = 35, normalized size of antiderivative = 2.06

method result size
risch \(-\frac {2 i A a \left (3 \,{\mathrm e}^{4 i \left (d x +c \right )}+1\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}\) \(35\)
derivativedivides \(\frac {-A a \left (-\frac {2}{3}-\frac {\csc \left (d x +c \right )^{2}}{3}\right ) \cot \left (d x +c \right )-A a \cot \left (d x +c \right )}{d}\) \(38\)
default \(\frac {-A a \left (-\frac {2}{3}-\frac {\csc \left (d x +c \right )^{2}}{3}\right ) \cot \left (d x +c \right )-A a \cot \left (d x +c \right )}{d}\) \(38\)
parts \(-\frac {a A \cot \left (d x +c \right )}{d}-\frac {A a \left (-\frac {2}{3}-\frac {\csc \left (d x +c \right )^{2}}{3}\right ) \cot \left (d x +c \right )}{d}\) \(40\)
parallelrisch \(\frac {A a \sec \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} \csc \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} \left (\cos \left (3 d x +3 c \right )+3 \cos \left (d x +c \right )\right )}{96 d}\) \(48\)
norman \(\frac {\frac {A a}{24 d}-\frac {A a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{8 d}+\frac {A a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{8 d}-\frac {A a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{24 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}\) \(75\)

[In]

int(csc(d*x+c)^2*(a-a*csc(d*x+c))*(A+A*csc(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

-2/3*I*A*a*(3*exp(4*I*(d*x+c))+1)/d/(exp(2*I*(d*x+c))-1)^3

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 36 vs. \(2 (15) = 30\).

Time = 0.24 (sec) , antiderivative size = 36, normalized size of antiderivative = 2.12 \[ \int \csc ^2(c+d x) (a-a \csc (c+d x)) (A+A \csc (c+d x)) \, dx=-\frac {A a \cos \left (d x + c\right )^{3}}{3 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \]

[In]

integrate(csc(d*x+c)^2*(a-a*csc(d*x+c))*(A+A*csc(d*x+c)),x, algorithm="fricas")

[Out]

-1/3*A*a*cos(d*x + c)^3/((d*cos(d*x + c)^2 - d)*sin(d*x + c))

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 54 vs. \(2 (14) = 28\).

Time = 0.85 (sec) , antiderivative size = 54, normalized size of antiderivative = 3.18 \[ \int \csc ^2(c+d x) (a-a \csc (c+d x)) (A+A \csc (c+d x)) \, dx=\begin {cases} \frac {- A a \left (- \frac {\cot ^{3}{\left (c + d x \right )}}{3} - \cot {\left (c + d x \right )}\right ) - A a \cot {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (A \csc {\left (c \right )} + A\right ) \left (- a \csc {\left (c \right )} + a\right ) \csc ^{2}{\left (c \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(csc(d*x+c)**2*(a-a*csc(d*x+c))*(A+A*csc(d*x+c)),x)

[Out]

Piecewise(((-A*a*(-cot(c + d*x)**3/3 - cot(c + d*x)) - A*a*cot(c + d*x))/d, Ne(d, 0)), (x*(A*csc(c) + A)*(-a*c
sc(c) + a)*csc(c)**2, True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 42 vs. \(2 (15) = 30\).

Time = 0.23 (sec) , antiderivative size = 42, normalized size of antiderivative = 2.47 \[ \int \csc ^2(c+d x) (a-a \csc (c+d x)) (A+A \csc (c+d x)) \, dx=-\frac {\frac {3 \, A a}{\tan \left (d x + c\right )} - \frac {{\left (3 \, \tan \left (d x + c\right )^{2} + 1\right )} A a}{\tan \left (d x + c\right )^{3}}}{3 \, d} \]

[In]

integrate(csc(d*x+c)^2*(a-a*csc(d*x+c))*(A+A*csc(d*x+c)),x, algorithm="maxima")

[Out]

-1/3*(3*A*a/tan(d*x + c) - (3*tan(d*x + c)^2 + 1)*A*a/tan(d*x + c)^3)/d

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.88 \[ \int \csc ^2(c+d x) (a-a \csc (c+d x)) (A+A \csc (c+d x)) \, dx=\frac {A a}{3 \, d \tan \left (d x + c\right )^{3}} \]

[In]

integrate(csc(d*x+c)^2*(a-a*csc(d*x+c))*(A+A*csc(d*x+c)),x, algorithm="giac")

[Out]

1/3*A*a/(d*tan(d*x + c)^3)

Mupad [B] (verification not implemented)

Time = 19.01 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.88 \[ \int \csc ^2(c+d x) (a-a \csc (c+d x)) (A+A \csc (c+d x)) \, dx=\frac {A\,a\,{\mathrm {cot}\left (c+d\,x\right )}^3}{3\,d} \]

[In]

int(((A + A/sin(c + d*x))*(a - a/sin(c + d*x)))/sin(c + d*x)^2,x)

[Out]

(A*a*cot(c + d*x)^3)/(3*d)